package uk.co.benbrown.jvis.model;

import java.util.ArrayList;
import java.util.List;

public class Phase {
    private String Id;
    private String name;
    private PhaseType phaseType;
    private List<Match> matches;

    public Phase() {

    }

    public Phase(String id, String name) {
	this.Id = id;
	this.name = name;
    }

    public String getId() {
	return Id;
    }

    public void setId(String id) {
	this.Id = id;
    }

    public List<Match> getMatches() {
	return matches;
    }

    public void setMatches(List<Match> matches) {
	this.matches = matches;
    }

    public void addMatch(Match match) {
	if (this.matches == null) {
	    this.matches = new ArrayList<Match>();
	}
	this.matches.add(match);
    }

    public void removeMatch(Match match) {
	if (this.matches == null) {
	    this.matches = new ArrayList<Match>();
	} else {
	    this.matches.remove(match);
	}
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public PhaseType getPhaseType() {
	return phaseType;
    }

    public void setPhaseType(PhaseType phaseType) {
	this.phaseType = phaseType;
    }
}
